package org.kumas.sgrpc.common.threadpool;

import java.util.concurrent.Executor;

import org.kumas.sgrpc.common.URL;
import org.kumas.sgrpc.common.extension.Adaptive;
import org.kumas.sgrpc.common.extension.SPI;

import static org.kumas.sgrpc.common.constants.CommonConstants.THREADPOOL_KEY;

@SPI("FixedThreadPool")
public interface ThreadPool {

    /**
     * Thread pool
     *
     * @param url URL contains thread parameter
     * @return thread pool
     */
    @Adaptive({THREADPOOL_KEY})
    Executor getExecutor(URL url);

}